Shader "ShaderEditor/EditorShaderCache"
{
	Properties 
	{
_ColorKlocek("_ColorKlocek", Color) = (0,0,0,1)
_ColorStrzalka("_ColorStrzalka", Color) = (1,1,1,1)
_StrzalkaAlpha("_StrzalkaAlpha", 2D) = "black" {}
_SpecularPower("_SpecularPower", Float) = 0
_SpecKlocek("_SpecKlocek", Color) = (1,1,1,1)
_SpecKlocekMulti("_SpecKlocekMulti", Float) = 0
_SpecStrzalka("_SpecStrzalka", Color) = (1,1,1,1)
_SpecStrzalkaMulti("_SpecStrzalkaMulti", Float) = 0
_MaskKlocek("_MaskKlocek", 2D) = "white" {}
_MaskStrzalka("_MaskStrzalka", Float) = 0

	}
	
	SubShader 
	{
		Tags
		{
"Queue"="Transparent"
"IgnoreProjector"="False"
"RenderType"="Transparent"

		}

		
Cull Back
ZWrite On
ZTest LEqual


		CGPROGRAM
#pragma surface surf BlinnPhongEditor alpha vertex:vert
#pragma target 2.0


float4 _ColorKlocek;
float4 _ColorStrzalka;
sampler2D _StrzalkaAlpha;
float _SpecularPower;
float4 _SpecKlocek;
float _SpecKlocekMulti;
float4 _SpecStrzalka;
float _SpecStrzalkaMulti;
sampler2D _MaskKlocek;
float _MaskStrzalka;

			struct EditorSurfaceOutput {
				half3 Albedo;
				half3 Normal;
				half3 Emission;
				half3 Gloss;
				half Specular;
				half Alpha;
			};
			
			inline half4 LightingBlinnPhongEditor_PrePass (EditorSurfaceOutput s, half4 light)
			{
half3 spec = light.a * s.Gloss;
half4 c;
c.rgb = (s.Albedo * light.rgb + light.rgb * spec);
c.a = s.Alpha + Luminance(spec);
return c;

			}

			inline half4 LightingBlinnPhongEditor (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
			{
				viewDir = normalize(viewDir);
				half3 h = normalize (lightDir + viewDir);
				
				half diff = max (0, dot (s.Normal, lightDir));
				
				float nh = max (0, dot (s.Normal, h));
				float3 spec = pow (nh, s.Specular*128.0) * s.Gloss;
				
				half4 res;
				res.rgb = _LightColor0.rgb * (diff * atten * 2.0);
				res.w = spec * Luminance (_LightColor0.rgb);

				return LightingBlinnPhongEditor_PrePass( s, res );
			}
			
			struct Input {
				float2 uv_StrzalkaAlpha;
float2 uv_MaskKlocek;

			};


			void vert (inout appdata_full v, out Input o) {
float4 VertexOutputMaster0_0_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_1_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_2_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_3_NoInput = float4(0,0,0,0);


			}
			

			void surf (Input IN, inout EditorSurfaceOutput o) {
				o.Albedo = 0.0;
				o.Normal = float3(0.0,0.0,1.0);
				o.Emission = 0.0;
				o.Gloss = 0.0;
				o.Specular = 0.0;
				o.Alpha = 1.0;
float4 Sampled2D0=tex2D(_StrzalkaAlpha,IN.uv_StrzalkaAlpha.xy);
float4 Lerp2=lerp(_ColorKlocek,_ColorStrzalka,Sampled2D0);
float4 Multiply0=_SpecKlocek * float4(_SpecKlocekMulti);
float4 Multiply2=_SpecStrzalka * float4(_SpecStrzalkaMulti);
float4 Lerp1=lerp(Multiply0,Multiply2,Sampled2D0);
float4 Sampled2D1=tex2D(_MaskKlocek,IN.uv_MaskKlocek.xy);
float4 Lerp0=lerp(float4( Sampled2D1.a),float4(_MaskStrzalka),Sampled2D0);
float4 Master0_1_NoInput = float4(0,0,1,1);
float4 Master0_2_NoInput = float4(0,0,0,0);
float4 Master0_6_NoInput = float4(1,1,1,1);
o.Albedo = Lerp2;
o.Specular = float4(_SpecularPower);
o.Gloss = Lerp1;
o.Alpha = Lerp0;

			}
		ENDCG
	}
	Fallback "Diffuse"
}